<?php

namespace App\Console\Commands;

use App\Lib\ConsumerTopupRebate;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;

class TopupRebate extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'topup:rebate {all=0}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '充值返利';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $all = (int)$this->argument('all');
        try {
            $consumer = new ConsumerTopupRebate();
            $ret = $consumer->consumer();
        } catch (\Exception $e) {
            Log::error($e->getMessage());
        }
    }
}
